home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Graphics / TVPaint / Rexx / fractal.rx < prev    next >
Encoding:
Text File  |  1995-11-07  |  885 b   |  67 lines

  1. /*    param none */
  2.  
  3. options results
  4.  
  5. address 'rexx_TVPaint'
  6.  
  7. tv_request 'This program will compute during 10 minutes. Continue ?'
  8. if (result=0) then exit
  9. tv_request 'Ready to wait 10 minutes ? Are you sure ?'
  10. if (result=0) then exit
  11.  
  12.  
  13.  
  14. /*  This program is just an experience. A slow game. George */
  15. /*  is NOT really designed to run this sort of exercise...  */
  16.  
  17.  
  18.  
  19. tv_SetDrawMode    Color
  20. tv_setBpen 0 0 0 255
  21. tv_clear
  22. tv_Pen 0
  23.  
  24. r=9
  25. a=-1.5
  26. b=-2
  27. c=2.5
  28. d=2
  29.  
  30.  
  31. tv_menuoff
  32. tv_mouseoff
  33. tv_LockUser
  34.  
  35. maxx=30
  36. maxy=30
  37.  
  38. n=1
  39. do m=1 to 5
  40.  
  41.     zz=n*9
  42.  
  43.     do k=zz to zz+maxx-2
  44.         do l=zz to zz+maxy-2
  45.  
  46.             x=a+((c-a)*k)/(maxx*n)
  47.             y=b+((d-b)*l)/(maxy*n)
  48.             color=23
  49.             u=0
  50.             v=0
  51.             do until ((u*u+v*v>r)|(color>247))
  52.                 z=u*u-v*v-x
  53.                 w=2*u*v-y
  54.                 u=z
  55.                 v=w
  56.                 color=color+7
  57.             end
  58.             tv_writepixel k-zz+(maxx*m) l-zz+(maxy*m) 255 color 0 255
  59.         end
  60.     end
  61.     n=n*2
  62. end
  63. tv_menuon
  64. tv_UnLockUser
  65.  
  66. tv_warn Done
  67.